<<<<<<< HEAD

import time, random
import pyodbc

def do_test():
    print 'Connecting...'

    connStr = 'DSN=sqws148-sq;UID=sqluser_admin;PWD=redhat06'
    conn = pyodbc.connect(connStr)

    cursor = conn.cursor()

    print 'Cleaning...'
    cursor.execute('delete from manageability.instance_repository.odbc_test')
    cursor.execute('commit')

    print 'Insert'

    for i in range(2000):
        sqlcmd = "insert into manageability.instance_repository.odbc_test" \
               + " values (%d, 'ccd_%s')" % (i, i);
        print '  ', sqlcmd
        cursor.execute(sqlcmd)

    cursor.execute('commit')

    cursor.execute('select * from manageability.instance_repository.odbc_test order by id')

    for row in cursor.fetchall():
        print row

    print 'Final test...'
#   cursor.execute('select * from manageability.instance_repository.METRIC_PROCESS_SUMMARYTOP_1')

    cursor.close()
    conn.close()

while True:
     do_test()

     time.sleep(random.randint(1,10))

     break
=======

import time, random
import pyodbc

def do_test():
    print 'Connecting...'

    connStr = 'DSN=sq169;UID=sqluser_admin;PWD=redhat06'
    conn = pyodbc.connect(connStr)

    cursor = conn.cursor()

    print 'Cleaning...'
    cursor.execute('delete from manageability.instance_repository.odbc_test')
    cursor.execute('commit')

    print 'Insert'

    for i in range(20):
        sqlcmd = "insert into manageability.instance_repository.odbc_test" \
               + " values (%d, 'ccd_%s')" % (i, i);
        print '  ', sqlcmd
        cursor.execute(sqlcmd)

    cursor.execute('commit')

    cursor.execute('select * from manageability.instance_repository.odbc_test order by id')

    for row in cursor.fetchall():
        print row

    print 'Final test...'
    cursor.execute('select * from manageability.instance_repository.METRIC_PROCESS_SUMMARYTOP_1')

    cursor.close()
    conn.close()

while True:
     do_test()

     time.sleep(random.randint(1,10))
>>>>>>> ede08fc4ed33342b6c480d7ddc4b5a5d6652a081
